# Author:Zhang Yu
import threading
import time
event = threading.Event()
def run():
    count =0
    while True:
        if count > 5 and count <10:
            event.clear()
        elif count >10:
            event.set()
            count = 0
        print("count: ",count)
        time.sleep(1)
        count +=1
def car(name):
    while True:
        if event.is_set():
            print("GO")
            time.sleep(1)
        else:
            print("STOP")
            event.wait()
l = threading.Thread(target=run,)
l.start()

c = threading.Thread(target=car,args=("name",))
c.start()